/*
 * Copyright 2004 original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.jbfilter.impl;

import java.util.Date;

import org.jbfilter.bean.PropertyAccessor;
import org.jbfilter.bean.factory.FilterComponentBeansProvider;
import org.jbfilter.bean.fcomps.logic.AndFilterComponentBean;
import org.jbfilter.bean.fcomps.logic.DynamicLogicFilterComponentBean;
import org.jbfilter.bean.fcomps.logic.OrFilterComponentBean;
import org.jbfilter.bean.fcomps.logic.XorFilterComponentBean;
import org.jbfilter.bean.fcomps.multiple.StartEndDateFilterComponentBean;
import org.jbfilter.bean.fcomps.single.ComparableFilterComponentBean;
import org.jbfilter.bean.fcomps.single.ComparatorFilterComponentBean;
import org.jbfilter.bean.fcomps.single.ContainsStringFilterComponentBean;
import org.jbfilter.bean.fcomps.single.DateFilterComponentBean;
import org.jbfilter.bean.fcomps.single.EqualsFilterComponentBean;
import org.jbfilter.bean.fcomps.single.RegexFilterComponentBean;
import org.jbfilter.bean.fcomps.single.StringFilterComponentBean;

public class FilterComponentBeansProviderImpl implements FilterComponentBeansProvider {

	// StringFilterComponent
	@Override
	public <E> StringFilterComponentBean<E> newStringFilterComponent(String id) {
		return new _StringFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> StringFilterComponentBean<E> newStringFilterComponent(String id, String propertyPath) {
		return new _StringFilterComponentBeanImpl<E>(id, propertyPath);
	}
	@Override
	public <E> StringFilterComponentBean<E> newStringFilterComponent(String id, PropertyAccessor<E, String> propertyAccessor) {
		return new _StringFilterComponentBeanImpl<E>(id, propertyAccessor);
	}
	@Override
	public <E> StringFilterComponentBean<E> newStringFilterComponent() {
		return new _StringFilterComponentBeanImpl<E>();
	}

	// EqualsFilterComponent
	@Override
	public <E, T> EqualsFilterComponentBean<E, T> newEqualsFilterComponent(String id) {
		return new _EqualsFilterComponentBeanImpl<E, T>(id);
	}
	@Override
	public <E, T> EqualsFilterComponentBean<E, T> newEqualsFilterComponent(String id, String propertyPath) {
		return new _EqualsFilterComponentBeanImpl<E, T>(id, propertyPath);
	}
	@Override
	public <E, T> EqualsFilterComponentBean<E, T> newEqualsFilterComponent(String id, PropertyAccessor<E, T> propertyAccessor) {
		return new _EqualsFilterComponentBeanImpl<E, T>(id, propertyAccessor);
	}
	@Override
	public <E, T> EqualsFilterComponentBean<E, T> newEqualsFilterComponent() {
		return new _EqualsFilterComponentBeanImpl<E, T>();
	}

	// ContainsStringFilter
	@Override
	public <E> ContainsStringFilterComponentBean<E> newContainsStringFilterComponent(String id) {
		return new _ContainsStringFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> ContainsStringFilterComponentBean<E> newContainsStringFilterComponent(String id, String propertyPath) {
		return new _ContainsStringFilterComponentBeanImpl<E>(id, propertyPath);
	}
	@Override
	public <E> ContainsStringFilterComponentBean<E> newContainsStringFilterComponent(String id, PropertyAccessor<E, String> propertyAccessor) {
		return new _ContainsStringFilterComponentBeanImpl<E>(id, propertyAccessor);
	}
	@Override
	public <E> ContainsStringFilterComponentBean<E> newContainsStringFilterComponent() {
		return new _ContainsStringFilterComponentBeanImpl<E>();
	}

	// RegexFilterComponent
	@Override
	public <E> RegexFilterComponentBean<E> newRegexFilterComponent(String id) {
		return new _RegexFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> RegexFilterComponentBean<E> newRegexFilterComponent(String id, String propertyPath) {
		return new _RegexFilterComponentBeanImpl<E>(id, propertyPath);
	}
	@Override
	public <E> RegexFilterComponentBean<E> newRegexFilterComponent(String id, PropertyAccessor<E, String> propertyAccessor) {
		return new _RegexFilterComponentBeanImpl<E>(id, propertyAccessor);
	}
	@Override
	public <E> RegexFilterComponentBean<E> newRegexFilterComponent() {
		return new _RegexFilterComponentBeanImpl<E>();
	}

	// DateFilterComponent
	@Override
	public <E> DateFilterComponentBean<E> newDateFilterComponent(String id) {
		return new _DateFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> DateFilterComponentBean<E> newDateFilterComponent(String id, String propertyPath) {
		return new _DateFilterComponentBeanImpl<E>(id, propertyPath);
	}
	@Override
	public <E> DateFilterComponentBean<E> newDateFilterComponent(String id, PropertyAccessor<E, Date> propertyAccessor) {
		return new _DateFilterComponentBeanImpl<E>(id, propertyAccessor);
	}
	@Override
	public <E> DateFilterComponentBean<E> newDateFilterComponent() {
		return new _DateFilterComponentBeanImpl<E>();
	}

	// StartEndDateFilterComponent
	@Override
	public <E> StartEndDateFilterComponentBean<E> newStartEndDateFilterComponent(String id) {
		return new _StartEndDateFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> StartEndDateFilterComponentBean<E> newStartEndDateFilterComponent(String id, String propertyPath) {
		return new _StartEndDateFilterComponentBeanImpl<E>(id, propertyPath);
	}
	@Override
	public <E> StartEndDateFilterComponentBean<E> newStartEndDateFilterComponent(String id, PropertyAccessor<E, Date> propertyAccessor) {
		return new _StartEndDateFilterComponentBeanImpl<E>(id, propertyAccessor);
	}
	@Override
	public <E> StartEndDateFilterComponentBean<E> newStartEndDateFilterComponent() {
		return new _StartEndDateFilterComponentBeanImpl<E>();
	}

	// ComparableFilterComponent
	@Override
	public <E, T extends Comparable<? super T>> ComparableFilterComponentBean<E, T> newComparableFilterComponent(String id) {
		return new _ComparableFilterComponentBeanImpl<E, T>(id);
	}
	@Override
	public <E, T extends Comparable<? super T>> ComparableFilterComponentBean<E, T> newComparableFilterComponent(String id, String propertyPath) {
		return new _ComparableFilterComponentBeanImpl<E, T>(id, propertyPath);
	}
	@Override
	public <E, T extends Comparable<? super T>> ComparableFilterComponentBean<E, T> newComparableFilterComponent(String id, PropertyAccessor<E, T> propertyAccessor) {
		return new _ComparableFilterComponentBeanImpl<E, T>(id, propertyAccessor);
	}
	@Override
	public <E, T extends Comparable<? super T>> ComparableFilterComponentBean<E, T> newComparableFilterComponent() {
		return new _ComparableFilterComponentBeanImpl<E, T>();
	}

	// ComparatorFilterComponent
	@Override
	public <E, T> ComparatorFilterComponentBean<E, T> newComparatorFilterComponent(String id) {
		return new _ComparatorFilterComponentBeanImpl<E, T>(id);
	}
	@Override
	public <E, T> ComparatorFilterComponentBean<E, T> newComparatorFilterComponent(String id, String propertyPath) {
		return new _ComparatorFilterComponentBeanImpl<E, T>(id, propertyPath);
	}
	@Override
	public <E, T> ComparatorFilterComponentBean<E, T> newComparatorFilterComponent(String id, PropertyAccessor<E, T> propertyAccessor) {
		return new _ComparatorFilterComponentBeanImpl<E, T>(id, propertyAccessor);
	}
	@Override
	public <E, T> ComparatorFilterComponentBean<E, T> newComparatorFilterComponent() {
		return new _ComparatorFilterComponentBeanImpl<E, T>();
	}

	// AndFilterComponent
	@Override
	public <E> AndFilterComponentBean<E> newAndFilterComponent(String id) {
		return new _AndFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> AndFilterComponentBean<E> newAndFilterComponent() {
		return new _AndFilterComponentBeanImpl<E>();
	}

	// OrFilterComponent
	@Override
	public <E> OrFilterComponentBean<E> newOrFilterComponent(String id) {
		return new _OrFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> OrFilterComponentBean<E> newOrFilterComponent() {
		return new _OrFilterComponentBeanImpl<E>();
	}

	// XorFilterComponent
	@Override
	public <E> XorFilterComponentBean<E> newXorFilterComponent(String id) {
		return new _XorFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> XorFilterComponentBean<E> newXorFilterComponent() {
		return new _XorFilterComponentBeanImpl<E>();
	}
	
	// DynamicLogicFilterComponent
	@Override
	public <E> DynamicLogicFilterComponentBean<E> newDynamicLogicFilterComponent(String id) {
		return new _DynamicLogicFilterComponentBeanImpl<E>(id);
	}
	@Override
	public <E> DynamicLogicFilterComponentBean<E> newDynamicLogicFilterComponent() {
		return new _DynamicLogicFilterComponentBeanImpl<E>();
	}
}
